local Stack = {}
local mt = {__index = Stack}


function Stack.new()
    return setmetatable({storage={}}, mt)
end


function Stack:length()
    return #self.storage
end


function Stack:isEmpty()
    if #self.storage == 0 then
        return true
    else
        return false
    end
end


function Stack:push(element)
    if element then
        table.insert(self.storage, element)
    end
end


function Stack:pop()
    if not self:isEmpty() then
        return table.remove(self.storage)
    end
end


return Stack